package com.llkj.contractmanagement.contractmanagement.contract;

import android.content.Intent;
import android.os.Bundle;
import android.widget.ListView;

import com.llkj.contractmanagement.main.BaseActivity;
import com.llkj.contractmanagement.R;
import com.llkj.contractmanagement.contractmanagement.adapter.SystemMessageDetailsAdapter;
import com.llkj.contractmanagement.customview.TitleBar;
import com.llkj.contractmanagement.model.SystemMessageBean;

import java.util.ArrayList;
import java.util.List;

import butterknife.Bind;

/**
 * author: dong.yj
 * created on: 2016/8/17 11:59
 * description:系统通知详情界面
 */
public class SystemMessageDetailsActivity extends BaseActivity  {

    @Bind(R.id.title_system_message_details)
    TitleBar titleBar;
    @Bind(R.id.lv_system_message_details)
    ListView lv_details;
    private List<SystemMessageBean.XxlistBean> detailsList;
    private SystemMessageDetailsAdapter adapter;
    private SystemMessageBean.XxlistBean xxlistBean;

    @Override
    protected int getLayoutResId() {
        return R.layout.activity_system_message_details;
    }

    @Override
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        init();
    }

    private void init() {
        initData();
        setListener();
    }

    private void setListener() {
        titleBar.setTopBarClickListener(this);

    }

    private void initData() {
        Intent intent = getIntent();
        if (intent != null) {
            xxlistBean = (SystemMessageBean.XxlistBean) getIntent().getSerializableExtra("messageList");
        }
        detailsList = new ArrayList<>();
        detailsList.add(xxlistBean);
        adapter = new SystemMessageDetailsAdapter(this,detailsList);
        lv_details.setAdapter(adapter);
    }

}
